// 入口文件
import Vue from "vue";
import Vuex from "vuex";
import MES from "../utils/mesUtils";

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    count: 0,
    newestDevSn: 0, // 最新设备编号
    wsEchartsDataState: {
      name: "",
      date: [],
      wen: [],
      shi: []
    },
    /**
     * 能耗 store
     */
    kongTiaoGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    kongYaGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },

    /**
     * Echarts store
     */
    dianBiaoGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts1State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts2State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts3State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts4State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts5State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts6State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts7State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts8State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts10State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts11State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts12State: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    echarts12LineState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    /**
     * 分组数据store
     */
    runningStatus: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    runningStatusDetail: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    wenShiGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    wenShiGroupStateList: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongGroupState1: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaLineState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    txcsomlGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    shuMianJiGroupState: {
      code: 0,
      data1: [],
      data2: [],
      msg: "",
      status: ""
    },
    bingTiaoGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    duoCangGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    zhuaMianGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    kaiMianGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    qingHuaGroupState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    /**
     * 实时数据store
     */
    bingTiaoNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    // 梳棉机、梳棉机A共同处理
    shuMianJiNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    txcsomlNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    duoCangNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    kaiMianNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    zhuaMianNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    dongLiNewestState: {
      code: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    xiShaDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    cuShaGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    cuShaWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    cuShaWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    cuShaDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    luoTongDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    jingTiaoGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    jingTiaoWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    jingTiaoWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    jingTiaoDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    qingHuaGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    qingHuaWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    qingHuaWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    qingHuaDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    shuMianGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    shuMianWorkerGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    shuMianWorkerSumGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    },
    shuMianDetailGroupNewestState: {
      cose: 0,
      data: [],
      msg: "",
      status: ""
    }
  },
  mutations: {
    /**
     * 能耗
     * */
    //空调
    optKongTiaoGroup: (state, params) => {
      const { kongTiaoGroupState } = state;
      state.kongTiaoGroupState = { ...kongTiaoGroupState, ...params };
    },
    //空压
    optKongYaGroup: (state, params) => {
      const { kongYaGroupState } = state;
      state.kongYaGroupState = { ...kongYaGroupState, ...params };
    },

    /**
     * 电表信息（ECHARTS）
     * */
    //echarts9
    optDianBiaoGroup: (state, params) => {
      const { dianBiaoGroupState } = state;
      state.dianBiaoGroupState = { ...dianBiaoGroupState, ...params };
    },
    optEcharts1: (state, params) => {
      const { echarts1State } = state;
      state.echarts1State = { ...echarts1State, ...params };
    },
    optEcharts2: (state, params) => {
      const { echarts2State } = state;
      state.echarts2State = { ...echarts2State, ...params };
    },
    optEcharts3: (state, params) => {
      const { echarts3State } = state;
      state.echarts3State = { ...echarts3State, ...params };
    },
    optEcharts4: (state, params) => {
      const { echarts4State } = state;
      state.echarts4State = { ...echarts4State, ...params };
    },
    optEcharts5: (state, params) => {
      const { echarts5State } = state;
      state.echarts5State = { ...echarts5State, ...params };
    },
    optEcharts6: (state, params) => {
      const { echarts6State } = state;
      state.echarts6State = { ...echarts6State, ...params };
    },
    optEcharts7: (state, params) => {
      const { echarts7State } = state;
      state.echarts7State = { ...echarts7State, ...params };
    },
    optEcharts8: (state, params) => {
      const { echarts8State } = state;
      state.echarts8State = { ...echarts8State, ...params };
    },
    optEcharts10: (state, params) => {
      const { echarts10State } = state;
      state.echarts10State = { ...echarts10State, ...params };
    },
    optEcharts11: (state, params) => {
      const { echarts11State } = state;
      state.echarts11State = { ...echarts11State, ...params };
    },
    optEcharts12: (state, params) => {
      const { echarts12State } = state;
      state.echarts12State = { ...echarts12State, ...params };
    },
    optEcharts12Line: (state, params) => {
      const { echarts12LineState } = state;
      state.echarts12LineState = { ...echarts12LineState, ...params };
    },
    /**
     * 最新设备编号
     * */
    optNewestDevSn: (state, params) => {
      state.newestDevSn = params.devSn;
    },
    /**
     * 分组数据
     */
    // 更新温湿度分组数据
    optWenShiGroup: (state, params) => {
      const { wenShiGroupState } = state;
      state.wenShiGroupState = { ...wenShiGroupState, ...params };
    },
    optWenShiGroupList: (state, params) => {
      const { wenShiGroupStateList } = state;
      state.wenShiGroupStateList = { ...wenShiGroupStateList, ...params };
    },
    optWenShi: (state, params) => {
      const { wsEchartsDataState } = state;
      state.wsEchartsDataState = { ...wsEchartsDataState, ...params };
    },
    // 更新并条分组数据
    optBingTiaoGroup: (state, params) => {
      const { bingTiaoGroupState } = state;
      state.bingTiaoGroupState = { ...bingTiaoGroupState, ...params };
    },
    // 更新梳棉机分组数据
    optShuMianJiGroup: (state, params) => {
      const { shuMianJiGroupState } = state;
      state.shuMianJiGroupState = { ...shuMianJiGroupState, ...params };
    },
    // 更新太行细纱欧姆龙数据
    optTxcsomlGroup: (state, params) => {
      const { txcsomlGroupState } = state;
      state.txcsomlGroupState = { ...txcsomlGroupState, ...params };
    },
    // 获取细纱分组数据
    optXiShaGroup: (state, params) => {
      const { xiShaGroupState } = state;
      state.xiShaGroupState = { ...xiShaGroupState, ...params };
    },
    // 获取络筒分组数据1
    optLuoTongGroup1: (state, params) => {
      const { luoTongGroupState1 } = state;
      state.luoTongGroupState1 = { ...luoTongGroupState1, ...params };
      // state.luoTongGroupState1.data.push(params.data);
    },
    // 获取络筒分组数据
    optLuoTongGroup: (state, params) => {
      const { luoTongGroupState } = state;
      state.luoTongGroupState = { ...luoTongGroupState, ...params };
    },
    // 获取多仓分组数据
    optDuoCangGroup: (state, params) => {
      const { duoCangGroupState } = state;
      state.duoCangGroupState = { ...duoCangGroupState, ...params };
    },
    // 获取开棉机分组数据
    optKaiMianGroup: (state, params) => {
      const { kaiMianGroupState } = state;
      state.kaiMianGroupState = { ...kaiMianGroupState, ...params };
    },
    // 获取抓棉分组数据
    optZhuaMianGroup: (state, params) => {
      const { zhuaMianGroupState } = state;
      state.zhuaMianGroupState = { ...zhuaMianGroupState, ...params };
    },
    // 获取清化分组数据
    optQingHuaGroup: (state, params) => {
      const { qingHuaGroupState } = state;
      state.qingHuaGroupState = { ...qingHuaGroupState, ...params };
    },
    /**
     * 实时数据
     */
    // 清空实时数据
    removeAllNewest: (state) => {
      state.bingTiaoNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.shuMianJiNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.txcsomlNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.xiShaNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.luoTongNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.duoCangNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.zhuaMianNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.kaiMianNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.dongLiNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.xiShaLineState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.runningStatus = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.runningStatusDetail = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };      
      state.xiShaGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.xiShaWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.xiShaWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.xiShaDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.cuShaGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.cuShaWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.cuShaWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.cuShaDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.luoTongGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.luoTongWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.luoTongWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.luoTongDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.jingTiaoGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.jingTiaoWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.jingTiaoWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.jingTiaoDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.qingHuaGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.qingHuaWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.qingHuaWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.qingHuaDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.shuMianGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.shuMianWorkerGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.shuMianWorkerSumGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
      state.shuMianDetailGroupNewestState = {
        code: 0,
        data: [],
        msg: "",
        status: ""
      };
    },
    // 更新并条实时数据
    optBingTiaoNewest: (state, params) => {
      const { bingTiaoNewestState } = state;
      state.bingTiaoNewestState = { ...bingTiaoNewestState, ...params };
    },
    // 更新梳棉机实时数据
    optShuMianJiNewest: (state, params) => {
      const { shuMianJiNewestState } = state;
      state.shuMianJiNewestState = { ...shuMianJiNewestState, ...params };
    },
    // 更新太行细纱欧姆龙实时数据
    optTxcsomlNewest: (state, params) => {
      const { txcsomlNewestState } = state;
      state.txcsomlNewestState = { ...txcsomlNewestState, ...params };
    },
    // 更新细纱实时数据
    optXiShaNewest: (state, params) => {
      const { xiShaNewestState } = state;
      state.xiShaNewestState = { ...xiShaNewestState, ...params };
    },
    // 更新络筒实时数据
    optLuoTongNewest: (state, params) => {
      const { luoTongNewestState } = state;
      state.luoTongNewestState = { ...luoTongNewestState, ...params };
    },
    // 更新多仓实时数据
    optDuoCangNewest: (state, params) => {
      const { duoCangNewestState } = state;
      state.duoCangNewestState = { ...duoCangNewestState, ...params };
    },
    // 更新开棉实时数据
    optKaiMianNewest: (state, params) => {
      const { kaiMianNewestState } = state;
      state.kaiMianNewestState = { ...kaiMianNewestState, ...params };
    },
    // 更新抓棉实时数据
    optZhuaMianNewest: (state, params) => {
      const { zhuaMianNewestState } = state;
      state.zhuaMianNewestState = { ...zhuaMianNewestState, ...params };
    },
    // 更新动力实时数据
    optDongLiNewest: (state, params) => {
      const { dongLiNewestState } = state;
      state.dongLiNewestState = { ...dongLiNewestState, ...params };
    },
    // 更新细砂组实时数据
    optXishaGroupNewest: (state, params) => {
      const { xiShaGroupNewestState } = state;
      state.xiShaGroupNewestState = { ...xiShaGroupNewestState, ...params };
    },
    // 更新细砂折现图实时数据
    optXishaLineNewest: (state, params) => {
      const { xiShaLineState } = state;
      state.xiShaLineState = { ...xiShaLineState, ...params };
    },
    // 更新状态实时数据
    optRunningStatus: (state, params) => {
      const { runningStatus } = state;
      state.runningStatus = { ...runningStatus, ...params };
    },
    optRunningStatusDetail: (state, params) => {
      const { runningStatus } = state;
      state.runningStatusDetail = { ...runningStatus, ...params };
    },
    // 更新细砂用工组实时数据
    optXishaWorkerGroupNewest: (state, params) => {
      const { xiShaWorkerGroupNewestState } = state;
      state.xiShaWorkerGroupNewestState = { ...xiShaWorkerGroupNewestState, ...params };
    },
    // 更新细砂汇总用工组实时数据
    optXishaWorkerSumGroupNewest: (state, params) => {
      const { xiShaWorkerSumGroupNewestState } = state;
      state.xiShaWorkerSumGroupNewestState = { ...xiShaWorkerSumGroupNewestState, ...params };
    },
    // 更新细砂明细组实时数据
    optXishaDetailGroupNewest: (state, params) => {
      const { xiShaDetailGroupNewestState } = state;
      state.xiShaDetailGroupNewestState = { ...xiShaDetailGroupNewestState, ...params };
    },
    // 更新粗砂组实时数据
    optCushaGroupNewest: (state, params) => {
      const { cuShaGroupNewestState } = state;
      state.cuShaGroupNewestState = { ...cuShaGroupNewestState, ...params };
    },
    // 更新粗砂用工组实时数据
    optCushaWorkerGroupNewest: (state, params) => {
      const { cuShaWorkerGroupNewestState } = state;
      state.cuShaWorkerGroupNewestState = { ...cuShaWorkerGroupNewestState, ...params };
    },
    // 更新cu砂汇总用工组实时数据
    optCushaWorkerSumGroupNewest: (state, params) => {
      const { cuShaWorkerSumGroupNewestState } = state;
      state.cuShaWorkerSumGroupNewestState = { ...cuShaWorkerSumGroupNewestState, ...params };
    },
    // 更新细砂明细组实时数据
    optCushaDetailGroupNewest: (state, params) => {
      const { cuShaDetailGroupNewestState } = state;
      state.cuShaDetailGroupNewestState = { ...cuShaDetailGroupNewestState, ...params };
    },
    // 更新络筒组实时数据
    optLuotongGroupNewest: (state, params) => {
      const { luoTongGroupNewestState } = state;
      state.luoTongGroupNewestState = { ...luoTongGroupNewestState, ...params };
    },
    // 更新络筒用工组实时数据
    optLuotongWorkerGroupNewest: (state, params) => {
      const { luoTongWorkerGroupNewestState } = state;
      state.luoTongWorkerGroupNewestState = { ...luoTongWorkerGroupNewestState, ...params };
    },
    // 更新络筒汇总用工组实时数据
    optLuotongWorkerSumGroupNewest: (state, params) => {
      const { luoTongWorkerSumGroupNewestState } = state;
      state.luoTongWorkerSumGroupNewestState = { ...luoTongWorkerSumGroupNewestState, ...params };
    },
    // 更新络筒明细组实时数据
    optLuotongDetailGroupNewest: (state, params) => {
      const { luoTongDetailGroupNewestState } = state;
      state.luoTongDetailGroupNewestState = { ...luoTongDetailGroupNewestState, ...params };
    },
    // 更新井条组实时数据
    optJingtiaoGroupNewest: (state, params) => {
      const { jingTiaoGroupNewestState } = state;
      state.jingTiaoGroupNewestState = { ...jingTiaoGroupNewestState, ...params };
    },
    // 更新井条用工组实时数据
    optJingtiaoWorkerGroupNewest: (state, params) => {
      const { jingTiaoWorkerGroupNewestState } = state;
      state.jingTiaoWorkerGroupNewestState = { ...jingTiaoWorkerGroupNewestState, ...params };
    },
    // 更新井条汇总用工组实时数据
    optJingtiaoWorkerSumGroupNewest: (state, params) => {
      const { jingTiaoWorkerSumGroupNewestState } = state;
      state.jingTiaoWorkerSumGroupNewestState = { ...jingTiaoWorkerSumGroupNewestState, ...params };
    },
    // 更新井条明细组实时数据
    optJingtiaoDetailGroupNewest: (state, params) => {
      const { jingTiaoDetailGroupNewestState } = state;
      state.jingTiaoDetailGroupNewestState = { ...jingTiaoDetailGroupNewestState, ...params };
    },
    // 更新清花组实时数据
    optQinghuaGroupNewest: (state, params) => {
      const { qingHuaGroupNewestState } = state;
      state.qingHuaGroupNewestState = { ...qingHuaGroupNewestState, ...params };
    },
    // 更新清花用工组实时数据
    optQinghuaWorkerGroupNewest: (state, params) => {
      const { qingHuaWorkerGroupNewestState } = state;
      state.qingHuaWorkerGroupNewestState = { ...qingHuaWorkerGroupNewestState, ...params };
    },
    // 更新清花汇总用工组实时数据
    optQinghuaWorkerSumGroupNewest: (state, params) => {
      const { qingHuaWorkerSumGroupNewestState } = state;
      state.qingHuaWorkerSumGroupNewestState = { ...qingHuaWorkerSumGroupNewestState, ...params };
    },
    // 更新清花明细组实时数据
    optQinghuaDetailGroupNewest: (state, params) => {
      const { qingHuaDetailGroupNewestState } = state;
      state.qingHuaDetailGroupNewestState = { ...qingHuaDetailGroupNewestState, ...params };
    },
    // 更新梳棉组实时数据
    optShumianGroupNewest: (state, params) => {
      const { shuMianGroupNewestState } = state;
      state.shuMianGroupNewestState = { ...shuMianGroupNewestState, ...params };
    },
    // 更新梳棉用工组实时数据
    optShumianWorkerGroupNewest: (state, params) => {
      const { shuMianWorkerGroupNewestState } = state;
      state.shuMianWorkerGroupNewestState = { ...shuMianWorkerGroupNewestState, ...params };
    },
    // 更新梳棉汇总用工组实时数据
    optShumianWorkerSumGroupNewest: (state, params) => {
      const { shuMianWorkerSumGroupNewestState } = state;
      state.shuMianWorkerSumGroupNewestState = { ...shuMianWorkerSumGroupNewestState, ...params };
    },
    // 更新梳棉明细组实时数据
    optShumianDetailGroupNewest: (state, params) => {
      const { shuMianDetailGroupNewestState } = state;
      state.shuMianDetailGroupNewestState = { ...shuMianDetailGroupNewestState, ...params };
    }
  },
  getters: {},
  actions: {
    /**
     * 能耗
     */
    //空调
    actKongTiaoGroup: ({ commit }, params) => {
      MES.queryGroupKongTiao().then((res) => {
        // 请求成功更新数据
        commit("optKongTiaoGroup", res);
      });
    },
    //空压
    actKongYaGroup: ({ commit }, params) => {
      MES.queryGroupKongYa(params).then((res) => {
        // 请求成功更新数据
        commit("optKongYaGroup", res);
      });
    },
    // 获取细纱分组数据
    actWenShiData: ({ commit }, params) => {
      commit("optWenShi", params);
    },
    /**
     * Echarts数据
     */
    // 获取电表数据
    actDianBiaoGroup: ({ commit }, params) => {
      MES.queryGroupDianBiao().then((res) => {
        // 请求成功更新数据
        commit("optDianBiaoGroup", res);
      });
    },
    actEcharts1: ({ commit }, params) => {
      MES.queryEcharts1().then((res) => {
        // 请求成功更新数据
        commit("optEcharts1", res);
      });
    },
    actEcharts2: ({ commit }, params) => {
      MES.queryEcharts2().then((res) => {
        // 请求成功更新数据
        commit("optEcharts2", res);
      });
    },
    actEcharts3: ({ commit }, params) => {
      MES.queryEcharts3().then((res) => {
        // 请求成功更新数据
        commit("optEcharts3", res);
      });
    },
    actEcharts4: ({ commit }, params) => {
      MES.queryEcharts4().then((res) => {
        // 请求成功更新数据
        commit("optEcharts4", res);
      });
    },
    actEcharts5: ({ commit }, params) => {
      MES.queryEcharts5().then((res) => {
        // 请求成功更新数据
        commit("optEcharts5", res);
      });
    },
    actEcharts6: ({ commit }, params) => {
      MES.queryEcharts6().then((res) => {
        // 请求成功更新数据
        commit("optEcharts6", res);
      });
    },
    actEcharts7: ({ commit }, params) => {
      MES.queryEcharts7().then((res) => {
        // 请求成功更新数据
        commit("optEcharts7", res);
      });
    },
    actEcharts8: ({ commit }, params) => {
      MES.queryEcharts8().then((res) => {
        // 请求成功更新数据
        commit("optEcharts8", res);
      });
    },
    actEcharts10: ({ commit }, params) => {
      MES.queryEcharts10(params).then((res) => {
        // 请求成功更新数据
        commit("optEcharts10", res);
      });
    },
    actEcharts11: ({ commit }, params) => {
      MES.queryEcharts11(params).then((res) => {
        // 请求成功更新数据
        commit("optEcharts11", res);
      });
    },
    actEcharts12: ({ commit }, params) => {
      MES.queryEcharts12().then((res) => {
        // 请求成功更新数据
        commit("optEcharts12", res);
      });
    },
    actEcharts12Line: ({ commit }, params) => {
      MES.queryEcharts12Line(params).then((res) => {
        // 请求成功更新数据
        commit("optEcharts12Line", res);
      });
    },

    /**
     * 分组数据
     */
    // 温湿度表格分组数据
    actWenShiGroup: ({ commit }, params) => {
      MES.queryGroupWenShiList(params).then((res) => {
        // 请求成功更新数据
        commit("optWenShiGroup", res);
      });
    },
    actWenShiGroupList: ({ commit }, params) => {
      MES.queryGroupWenShiList24H(params).then((res) => {
        // 请求成功更新数据
        commit("optWenShiGroupList", res);
      });
    },
    // 获取并条分组数据
    actBingTiaoGroup: ({ commit }, params) => {
      MES.queryGroupBingTiaoList().then((res) => {
        // 请求成功更新数据
        commit("optBingTiaoGroup", res);
      });
    },
    // 获取梳棉机分组数据
    actShuMianJiGroup: ({ commit }, params) => {
      MES.queryGroupShuMianJiList().then((res) => {
        commit("optShuMianJiGroup", res);
      });
    },
    // 获取太行粗纱欧姆龙分组数据
    actTxcsomlGroup: ({ commit }, params) => {
      MES.queryGroupTxcsomlList().then((res) => {
        commit("optTxcsomlGroup", res);
      });
    },
    // 获取细纱分组数据
    actXiShaGroup: ({ commit }, params) => {
      MES.queryGroupXiShaList().then((res) => {
        commit("optXiShaGroup", res);
      });
    },
    // 获取络筒分组数据
    actLuoTongGroup: ({ commit }, params) => {
      MES.queryGroupLuoTongList().then((res) => {
        commit("optLuoTongGroup", res);
      });
    },
    // 获取络筒分组数据1
    actLuoTongGroup1: ({ commit }, params) => {
      MES.queryGroupLuoTongList1(params).then((res) => {
        commit("optLuoTongGroup1", res);
      });
    },
    // 获取多仓分组数据
    actDuoCangGroup: ({ commit }, params) => {
      MES.queryGroupDuoCangList().then((res) => {
        commit("optDuoCangGroup", res);
      });
    },
    // 获取开棉分组数据
    actKaiMianGroup: ({ commit }, params) => {
      MES.queryGroupKaiMianList().then((res) => {
        commit("optKaiMianGroup", res);
      });
    },
    // 获取抓棉分组数据
    actZhuaMianGroup: ({ commit }, params) => {
      MES.queryGroupZhuaMianList().then((res) => {
        commit("optZhuaMianGroup", res);
      });
    },
    // 获取清化分组数据
    actQingHuaGroup: ({ commit }, params) => {
      MES.queryGroupQingHuaList().then((res) => {
        commit("optQingHuaGroup", res);
      });
    },
    /**
     * 实时数据
     */
    // 获取并条实时数据
    actBingTiaoNewest: ({ commit }, params) => {
      MES.queryNewestBingTiao(params).then((res) => {
        // 请求成功更新数据
        commit("optBingTiaoNewest", res);
      });
    },
    // 获取梳棉机实时数据
    actShuMianJiNewest: ({ commit }, params) => {
      MES.queryNewestShuMianji(params).then((res) => {
        commit("optShuMianJiNewest", res);
      });
    },
    // 获取梳棉机A实时数据
    actShuMianJiANewest: ({ commit }, params) => {
      MES.queryNewestShuMianjiA(params).then((res) => {
        commit("optShuMianJiNewest", res);
      });
    },
    // 获取太行粗纱欧姆龙实时数据
    actTxcsomlNewest: ({ commit }, params) => {
      MES.queryNewestTxcsoml(params).then((res) => {
        commit("optTxcsomlNewest", res);
      });
    },
    // 获取新粗纱欧姆龙实时数据
    actCuShaJiNewest: ({ commit }, params) => {
      MES.queryNewestCuShaji(params).then((res) => {
        commit("optTxcsomlNewest", res);
      });
    },
    // 获取细纱实时数据
    actXiShaNewest: ({ commit }, params) => {
      MES.queryNewestXiShaMzl(params).then((res) => {
        commit("optXiShaNewest", res);
      });
    },
    // 获取络筒实时数据
    actLuoTongNewest: ({ commit }, params) => {
      MES.queryNewestLuoTong(params).then((res) => {
        commit("optLuoTongNewest", res);
      });
    },
    // 获取多仓实时数据
    actDuoCangNewest: ({ commit }, params) => {
      MES.queryNewestDuoCang(params).then((res) => {
        commit("optDuoCangNewest", res);
      });
    },
    // 获取开棉实时数据
    actKaiMianNewest: ({ commit }, params) => {
      MES.queryNewestKaiMian(params).then((res) => {
        commit("optKaiMianNewest", res);
      });
    },
    // 获取抓棉实时数据
    actZhuaMianNewest: ({ commit }, params) => {
      MES.queryNewestZhuaMian(params).then((res) => {
        commit("optZhuaMianNewest", res);
      });
    },
    // 获取动力实时数据
    actDongLiNewest: ({ commit }, params) => {
      MES.queryNewestDongLi(params).then((res) => {
        commit("optDongLiNewest", res);
      });
    },
    // 获取细砂实时数据
    actXishaGroupNewest: ({ commit }, params) => {
      MES.queryNewestXiSha(params).then((res) => {
        commit("optXishaGroupNewest", res);
      });
    },
    acXishaLineNewest: ({ commit }, params) => {
      MES.queryLineXiSha(params).then((res) => {
        commit("optXishaLineNewest", res);
      });
    },
    acRunningStatusNewest: ({ commit }, params) => {
      MES.queryStatus(params).then((res) => {
        commit("optRunningStatus", res);
      });
    },
    acRunningStatusDetailNewest: ({ commit }, params) => {
      MES.queryStatusDetail(params).then((res) => {
        commit("optRunningStatusDetail", res);
      });
    },
    // 获取细砂用工实时数据
    actXishaWorkerGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "细纱", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.detail };
        commit("optXishaWorkerGroupNewest", result);
      });
    },
    // 获取细砂用工汇总实时数据
    actXishaWorkerSumGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "细纱", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.summary };
        commit("optXishaWorkerSumGroupNewest", result);
      });
    },
    // 获取细砂明细实时数据
    actXishaDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestXiShaDetail(params).then((res) => {
        commit("optXishaDetailGroupNewest", res);
      });
    },
    // 获取粗砂实时数据
    actCushaGroupNewest: ({ commit }, params) => {
      MES.queryNewestCuSha(params).then((res) => {
        commit("optCushaGroupNewest", res);
      });
    },
    // 获取粗纱用工实时数据
    actCushaWorkerGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "粗纱", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.detail };
        commit("optCushaWorkerGroupNewest", result);
      });
    },
    // 获取粗纱用工汇总实时数据
    actCushaWorkerSumGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "粗纱", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.summary };
        commit("optCushaWorkerSumGroupNewest", result);
      });
    },
    // 获取粗纱明细实时数据
    actCushaDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestCuShaDetail(params).then((res) => {
        commit("optCushaDetailGroupNewest", res);
      });
    },
    // 获取络筒实时数据
    actLuotongGroupNewest: ({ commit }, params) => {
      MES.queryNewestLuoTong1(params).then((res) => {
        commit("optLuotongGroupNewest", res);
      });
    },
    // 获取络筒用工实时数据
    actLuotongWorkerGroupNewest: ({ commit }, params) => {
      MES.queryNewestLuoTongWorker(params).then((res) => {
        commit("optLuotongWorkerGroupNewest", res);
      });
      params = { cj: "五纺", gongxu: "络筒", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.detail };
        commit("optLuotongWorkerGroupNewest", result);
      });
    },
    // 获取络筒用工汇总实时数据
    actLuotongWorkerSumGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "络筒", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.summary };
        commit("optLuotongWorkerSumGroupNewest", result);
      });
    },
    // 获取络筒明细实时数据
    actLuotongDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestLuoTongDetail(params).then((res) => {
        commit("optLuotongDetailGroupNewest", res);
      });
    },
    // 获取井条实时数据
    actJingtiaoGroupNewest: ({ commit }, params) => {
      MES.queryNewestJingTiao(params).then((res) => {
        commit("optJingtiaoGroupNewest", res);
      });
    },
    // 获取井条用工实时数据
    actJingtiaoWorkerGroupNewest: ({ commit }, params) => {
      MES.queryNewestJingTiaoWorker(params).then((res) => {
        commit("optJingtiaoWorkerGroupNewest", res);
      });
      params = { cj: "五纺", gongxu: "并条", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.detail };
        commit("optJingtiaoWorkerGroupNewest", result);
      });
    },
    // 获取井条用工汇总实时数据
    actJingtiaoWorkerSumGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "并条", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.summary };
        commit("optJingtiaoWorkerSumGroupNewest", result);
      });
    },
    // 获取井条明细实时数据
    actJingtiaoDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestJingTiaoDetail(params).then((res) => {
        commit("optJingtiaoDetailGroupNewest", res);
      });
    },
    // 获取梳棉实时数据
    actShumianGroupNewest: ({ commit }, params) => {
      MES.queryNewestShuMian(params).then((res) => {
        commit("optShumianGroupNewest", res);
      });
    },
    // 获取梳棉用工实时数据
    actShumianWorkerGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "梳棉", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.detail };
        commit("optShumianWorkerGroupNewest", result);
      });
    },
    // 获取梳棉用工汇总实时数据
    actShumianWorkerSumGroupNewest: ({ commit }, params) => {
      params = { cj: "五纺", gongxu: "梳棉", ...params };
      MES.queryWorker(params).then((res) => {
        let result = { ...res, data: res.data.summary };
        commit("optShumianWorkerSumGroupNewest", result);
      });
    },
    // 获取梳棉明细实时数据
    actShumianDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestShuMianDetail(params).then((res) => {
        commit("optShumianDetailGroupNewest", res);
      });
    },
    // 获取清花实时数据
    actQinghuaGroupNewest: ({ commit }, params) => {
      MES.queryNewestQingHua(params).then((res) => {
        commit("optQinghuaGroupNewest", res);
      });
    },
    // 获取清花用工实时数据
    actQinghuaWorkerGroupNewest: ({ commit }, params) => {
      MES.queryNewestQingHuaWorker(params).then((res) => {
        commit("optQinghuaWorkerGroupNewest", res);
      });
    },
    // 获取清花用工汇总实时数据
    actQinghuaWorkerSumGroupNewest: ({ commit }, params) => {
      MES.queryNewestQingHuaWorkerSum(params).then((res) => {
        commit("optQinghuaWorkerSumGroupNewest", res);
      });
    },
    // 获取井条明细实时数据
    actQinghuaDetailGroupNewest: ({ commit }, params) => {
      MES.queryNewestQingHuaDetail(params).then((res) => {
        commit("optQinghuaDetailGroupNewest", res);
      });
    }
  }
});

export default store;
